<template>
	<view class="mainCss">
		<view class="titleBox">
			<view class="titleLeft">
				<img src="../../static/title/back.png" class="titleBack" @click="goBack">
			</view>
			<view class="titleText">
				<text>商铺出租详情</text>
			</view>
			<view class="titleRight">

			</view>
		</view>
		<view class="bannerBox">
			<swiper style="height: 300rpx;" autoplay="true" interval="3000" duration="500" circular="true">
				<swiper-item v-for="(item, index) in RoomInsideImage" :key="index">
					<view class="swiper-item">
						<image :src="Url + item" class="banner"></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="bodyBox">
			<view class="infoBox">
				<view class="infoTitle">
					<text>{{detailList.Address}}</text>
				</view>
				<view class="infoTop">
					<view class="infoTopBox">
						<view class="topCont">
							<text>{{detailList.Aera}}m²</text>
						</view>
						<view class="tips">
							<text>面积</text>
						</view>
					</view>
					<view class="infoTopBox">
						<view class="topCont">
							<text>{{detailList.TradePrice}}元/月</text>
						</view>
						<view class="tips">
							<text>付款金额</text>
						</view>
					</view>
					<view class="infoTopBox">
						<view class="topCont">
							<text>{{detailList.DistinctName}}</text>
						</view>
						<view class="tips">
							<text>区域</text>
						</view>
					</view>
				</view>
				<view class="allInfo">
					<view class="firstCont">
						<view class="contentBox">
							<view class="tips">
								<text>门店位置</text>
							</view>
							<view class="content">
								<text>{{detailList.Address}}</text>
							</view>
						</view>
						<view class="contentBox">
							<view class="tips">
								<text>商铺编号</text>
							</view>
							<view class="content" style="white-space: nowrap;">
								<text>{{detailList.ShopNum}}</text>
							</view>
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>付款方式</text>
						</view>
						<view class="content">
							<text>押{{PayType.Deposit}}付{{PayType.Pay}}</text>
							<!-- <text style="color: #FF5F17; margin-left: 20rpx;">租金面谈</text> -->
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>租期时长</text>
						</view>
						<view class="content">
							<text>{{detailList.ShortestTrade}}个月</text>
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>商铺规格</text>
						</view>
						<view class="content" style="position: relative;">
							<uni-icons  class="tishi" @click="boack" type="help-filled" size="20"></uni-icons>
							<text v-if="isShow" class="tishi-cont">高*宽*深</text>
							<text>{{detailList.Width}}*{{detailList.Height}}*{{detailList.Dpeth}}</text>
						</view>
					</view>
					<!-- <view class="contentBox">
						<view class="tips">
							<text>门店数据</text>
						</view>
						<view class="content">
							<text>{{detailList.ShopType}}</text>
						</view>
					</view> -->
					<view class="contentBox">
						<view class="tips">
							<text>配套设施</text>
						</view>
						<view class="content">
							<text>{{detailList.Surportings}}</text>
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>现商铺经营类型</text>
						</view>
						<view class="content">
							<text v-if="detailList.ShopType == 1">临街商铺</text>
							<text v-if="detailList.ShopType == 0">非临街商铺</text>
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>适合经营类型</text>
						</view>
						<view class="content">
							<text>{{detailList.suitFor}}</text>
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>商铺优势</text>
						</view>
						<view class="content">
							<text>{{advantage}}</text>
						</view>
					</view>
					<view class="contentBox">
						<view class="tips">
							<text>商铺描述</text>
						</view>
						<view class="content">
							<text>{{detailList.Description}}</text>
						</view>
					</view>
				</view>
				<view class="mapBox">
					<map :latitude="latitude" :longitude="longitude" include-points="points" 
					show-location="true"
					scale="13"
					style="width: 100%; height: 100%;"></map>
				</view>
				<view class="business">
					<img :src="BasicInfo.headImg" class="businessHead">
					<text>发布人:{{BasicInfo.nickName}}</text>
				</view>
			</view>
		</view>
		<!-- <view class="block">
			
		</view> -->
		<view class="footerBox">
			<view class="toolbar">
				<view class="leftTool">
					<view class="iconBox">
						<img src="../../static/lease/shoucang.png" class="collection" v-show="!shoucang"
							@click="shoucang = !shoucang">
						<img src="../../static/lease/shoucang1.png" class="collection" v-show="shoucang"
							@click="shoucang = !shoucang">
						<text v-show="!shoucang">收藏</text>
						<text v-show="shoucang">已收藏</text>
					</view>
					<view class="iconBox">
						<img src="../../static/lease/fenxiang.png" class="collection">
						<text>分享</text>
					</view>
				</view>
				<view class="rightTool">
					<view class="buttonView">
						<img src="../../static/lease/xiaoxi.png" class="xiaoxi">
						<text>微聊</text>
					</view>
					<button class="toolButton" @click="gopay">在线支付</button>
					<img src="../../static/lease/tishi.png" class="tipsIcon">
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				Url: 'https://ypsf.huashengzhuan.cn',
				latitude: '',
				longitude: '',
				// bannerList: [{
				// 	imgUrl: '../../static/lease/leaseBg.png',
				// }, {
				// 	imgUrl: '../../static/lease/leaseBg.png',
				// }, {
				// 	imgUrl: '../../static/lease/leaseBg.png',
				// }, {
				// 	imgUrl: '../../static/lease/leaseBg.png',
				// }],
				// shoucang: false,
				// shopName: '木渎便利店',
				// area: '200m²',
				// price: 5000,
				// region: '吴中区',
				// place: '吴中区木渎镇月清街12-8号',
				// identifier: 12,
				// payment: '押一付三',
				// time: '三年',
				// norms: '100 × 100 × 100',
				// datum: '10层',
				// facilities: '电梯、物业、安保',
				// type: '正在经营',
				// fit: '美容美发',
				advantage: '近地铁，周边设备齐全',
				describe: '商铺描述 商铺描述 商铺描述 商铺描述 商铺描述',
				detailList:[],
				RoomInsideImage: [],
				BasicInfo:[],
				PayType: [],
				points:[],
				isShow: false,
			}
		},
		onLoad(option) {
			this.id = option.id
			console.log(option.id)
			this.$myRequest({
				url: 'shopFrontDetail',
				data: {
						ShopFrontID: option.id,
					},
					dataType: 'json',
			}).then(res => {
				this.detailList = res.data;
				console.log(this.detailList)
				this.RoomInsideImage = res.data.RoomInsideImage
				this.RoomInsideImage = this.RoomInsideImage.split(',')
				// console.log(this.RoomInsideImage)
				this.BasicInfo = JSON.parse(this.detailList.BasicInfo)
				// console.log(this.BasicInfo)
				this.PayType = JSON.parse(this.detailList.PayType)
				this.latitude = Number(this.detailList.latitude)
				this.longitude = Number(this.detailList.Longitude)
				
			})
		},
		methods: {
			// 返回
			goBack() {
				uni.navigateBack(1)
			},
			// 首页
			goHome() {
				uni.switchTab({
					url: '/pages/home/index',
				})
			},
			gopay() {
				uni.navigateTo({
					url: '/pagesA/payA/payA?id=' + this.id
				})
			},
			boack() {
				this.isShow = true;
				setTimeout(() => {
					this.isShow = false
				}, 3000);
			}
		}
	}
</script>

<style>
	@import '../../css/details.css';
	/* .tishi{
		position: absolute;
		left: 120rpx;
	} */
	.tishi-cont{
		display: block;
		position: absolute;
		color: #A8A8A8;
		background-color: #fff;
	}
</style>
